package com.xiaowen.ssyx.project.controller;


import com.xiaowen.ssyx.common.result.Result;
import com.xiaowen.ssyx.project.service.FileUploadService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@Api(tags = "文件上传接口")
@RestController
@RequestMapping("admin/product")
public class FileUploadController {

    @Autowired
    private FileUploadService fileUploadService;

//    @ApiOperation("阿里云文件上传")
//    @PostMapping("fileUpload")
//    public Result fileUpload(MultipartFile file) throws Exception {
//        return Result.ok(fileUploadService.fileUpload(file));
//    }


    @ApiOperation("minio文件上传")
    @PostMapping("fileUpload")
    public Result fileUpload(@RequestParam MultipartFile file) throws Exception {
        return Result.ok(fileUploadService.minioFileUpload(file));
    }


}
